<template>
  <div class="article-item">
    <van-cell :to="'/detail/'+row.art_id" :title="row.title" label-class="label">
      <template v-if="row.cover.type === 1" #default>
        <van-image
          width="116px"
          height="73px"
          fit="fill"
          :src="row.cover.images[0]"
        />
      </template>
      <template  #label>
        <div class="img-box" v-if="row.cover.type===3">
          <van-image
            width="111px"
            height="73px"
            fit="fill"
            v-for="(item,index) in row.cover.images"
            :key="index"
            :src="item"
          />
        </div>
        <span>{{row.aut_name}}</span>
        <span class="comment">{{row.comm_count}}评论</span>
        <span>{{row.pubdate | relativeTime}}</span>
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'ArticleItem',
  props: {
    row: {
      type: Object,
      required: true
    }
  },
  data () {
    return {}
  },

  created () {},

  methods: {}
}
</script>

<style scoped lang="less">
.article-item {
  .label {
    .comment {
      margin: 0 10px;
    }
    .img-box{
      display: flex;
      justify-content: space-between;
    }
  }
}
</style>
